package ca.michaelmaguire.server.mobiledownload.server.entity;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@SuppressWarnings("serial")
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class AppEvent implements Serializable {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;

	@Persistent
	private Key userinfo;

	@Persistent
	private Key appcontent;

	@Persistent
	private Date created;

	@Persistent
	private String type;

	@Persistent
	private String useragent;

	@Persistent
	private String url;

	@Persistent
	private String referer;

	public static final String VISIT = "visit";
	public static final String DOWNLOAD = "download";
	public static final String INSTALL = "install";
	public static final String UNINSTALL = "uninstall";
	public static final String USE = "use";

	public Key getKey() {
		return key;
	}

	public void setKey(Key aKey) {
		this.key = aKey;
	}

	public Key getUserInfo() {
		return userinfo;
	}

	public void setUserInfo(Key aUserInfo) {
		this.userinfo = aUserInfo;
	}

	public void setAppContent(Key aAppContent) {
		this.appcontent = aAppContent;
	}

	public Key getAppContent() {
		return appcontent;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getUserAgent() {
		return useragent;
	}

	public void setUserAgent(String aUserAgent) {
		this.useragent = aUserAgent;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String aUrl) {
		this.url = aUrl;
	}

	public String getReferer() {
		return referer;
	}

	public void setReferer(String aReferer) {
		this.referer = aReferer;
	}

	public Long getId() {
		return this.key.getId();
	}

}
